package com.wanxi.controller;

import com.wanxi.entity.Result;
import com.wanxi.vo.BrandVo;
import com.wanxi.vo.PageVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * @author yangjin
 * @date 2022年08月10日 16:25
 */
@RestController
@RequestMapping("/web/brand")
@Api(tags = "商品品牌管理")
public class BrandController {
    @GetMapping("/brandList")
    @ApiOperation("商品品牌列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "brandId",value = "品牌Id",dataType = "Integer"),
            @ApiImplicitParam(name = "brandName",value = "品牌名称",dataType = "String")
    })
    public Result cateList(Integer brandId,String brandName, PageVo pageVo){

        return new Result("",0,new BrandVo(),10,null);
    }

    @PostMapping("/addBrand")
    @ApiOperation("商品品牌添加")
    public Result addBrand(@RequestBody BrandVo brandVo){
        return new Result("add successful",200,null,0,null);
    }

    @PostMapping("/brandUpdate")
    @ApiOperation("商品品牌编辑")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "brandId",value = "品牌Id",required = true,dataType = "Integer"),
    })
    public Result cateUpdate(@RequestParam Integer brandId,@RequestBody BrandVo brandVo){

        return new Result("update successful",200,null,1,null);
    }

    @PostMapping("/brandDelete")
    @ApiOperation("商品品牌删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "brandId",value = "品牌Id",required = true,dataType = "Integer"),

    })
    public Result cateDelete(@RequestParam Integer brandId){

        return new Result("delete successful",200,null,1,null);
    }

    @GetMapping("/brandFindById")
    @ApiOperation("按Id查询单条品牌")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "brandId",value = "品牌Id",required = true,dataType = "Integer"),
    })
    public Result brandFindById(@RequestParam Integer brandId){
        return new Result("",0,new BrandVo(),1,null);
    }
}
